﻿@using NewLife.Common;
@{
    var user = ViewBag.User as IUser ?? User.Identity as IUser;
    var page = ViewBag.Page as Pager;
}
<div class="btn-group">
    <button data-toggle="dropdown" class="btn btn-info btn-sm btn-sm-force dropdown-toggle" aria-expanded="false">
        高级
        <span class="ace-icon fa fa-caret-down icon-on-right"></span>
    </button>

    <ul class="dropdown-menu dropdown-info dropdown-menu-right">
        <li>
            <a href="@Url.Action("ExportExcel")" title="导出Csv格式，中文表头，含扩展属性，用于Excel查看数据">导出Excel</a>
        </li>
        <li>
            <a href="@Url.Action("ExportCsv")" title="导出Csv格式，英文表头，不含扩展属性，快速导出，用于数据传输">导出Csv</a>
        </li>
        <li>
            <a href="@Url.Action("ExportXml")">导出Xml</a>
        </li>
        <li>
            <a href="@Url.Action("ExportJson")">导出Json</a>
        </li>
        <li class="divider"></li>
        <li>
            <a href="@Url.Action("Share")" title="把当前页数据分享给其他人">分享</a>
        </li>
        <li>
            <a href="@Url.Action("Sync")" data-action="action" data-confirm="该操作将清空数据并不可恢复！确认同步？" title="清空并从主服务器同步数据">同步</a>
        </li>
        @if (this.Has(PermissionFlags.Delete))
        {
            <li class="divider"></li>
            <li>
                <a href="@Url.Action("DeleteSelect")" data-action="action" data-fields="keys" data-confirm="该操作将删除选中数据并不可恢复！确认删除？" title="删除选中数据">删除选中</a>
            </li>
            <li>
                <a href="@Url.Action("DeleteAll")" data-action="action" data-confirm="该操作将删除当前查询的所有数据并不可恢复！确认删除？" title="删除当前查询的所有数据">删除全部</a>
            </li>
        }
        @if (SysConfig.Current.Develop && user.Role.IsSystem)
        {
            <li class="divider"></li>
            <li>
                <a href="@Url.Action("Backup")" data-action="action" title="备份到服务器本地目录">备份</a>
            </li>
            <li>
                <a href="@Url.Action("Restore")" data-action="action" title="从服务器本地目录还原">还原</a>
            </li>
            <li>
                <a href="@Url.Action("BackupAndExport")" title="备份并下载">备份导出</a>
            </li>
            <li class="divider"></li>
            if (page == null || page.Params.Count == 0)
            {
                <li>
                    <a href="@Url.Action("Clear")" data-action="action" data-confirm="该操作将删除数据表所有数据并不可恢复！确认清空？" title="删除数据表所有数据">清空数据表</a>
                </li>
            }
            <li>
                <a href="@Url.Action("MakeList")">生成列表</a>
            </li>
            <li>
                <a href="@Url.Action("MakeForm")">生成表单</a>
            </li>
            <li>
                <a href="@Url.Action("MakeSearch")">生成搜索</a>
            </li>
        }
    </ul>
</div><!-- /.btn-group -->